sum(200,400);//600
console.log(total);//undefined
sum(1,2);// 3
var total = 100;//
console.log(total);//100
console.log(count);//undefined
var count = 0;
console.log(count);//0
var name = 'john';

function sum(a,b){
    return a + b;
} // function declaration
console.log(subtract);//undefined
subtract(1,2);// undefined is not a function
//sum();//call a function

var subtract = function(a,b){
    //this is used for subtraction
    return b - a;
} // function expression
console.log(subtract);//function (a,b){
//this is used for subtraction
//return b - a;
//}


function sum(a,b){
    console.log('passed a is ' + a);
    //return 'sum canot be calculated';//it will come out of the function
    console.log('passed b is ' + b);
  // return a + b;
    //return undefined
}

var total = sum(20,30);//undefined
console.log('sum of 20 and 30 is ' + total);//
